import { eventHandler } from 'h3';

export default eventHandler(async (event) => {
  const { status, name, defaultRouter, remark, sort, id } =
    await readBody(event);
  // 修改
  MOCK_ROLE_LIST_DATA.forEach((item) => {
    if (item.id === id) {
      item.status = status as any;
      item.name = name;
      item.defaultRouter = defaultRouter;
      item.remark = remark;
      item.sort = sort;
    }
  });
  return useResponseSuccess({
    res: true,
    message: '修改语料成功',
    id,
  });
});
